<form class="form-horizontal" role="form" id="ae_form" action="/italiaCives/news/Create?tipo=eventi" method="post">
<input type="hidden" name="id" value="{{pageData['dao'].id}}"/>
<input type='hidden' name='formSubmission' id='mySubmission'/>
    <div class="form-group" title="">
        <label class="col-sm-2 col-lg-2 control-label" for="title">Titolo:</label>
        <div class="col-sm-7 col-lg-7">
            <input class="form-control" type="text" id="title" name="title" size="10" value='{{pageData["dao"].title|nonone}}' />
        </div>
    </div>

    <div class="form-group" title="">
        <label class="col-sm-2 col-lg-2 control-label" for="body">Corpo</label>
        <div class="col-sm-10 col-lg-10">
            <div id="summernote2">{{pageData["dao"].body|nonone}}</div>
            </div>
    </div>
    <div class="form-group">
        <div class="col-sm-5 col-lg-5 col-sm-offset-2">
        <div class="checkbox">
            <label>
                <input type="checkbox" id="active" name="active"  {{ "checked" if pageData["dao"].active == True }} > Attiva
            </label>
        </div>
        </div>
   </div>

     <div class="form-group">
        <label class="col-sm-2 col-lg-2 control-label" for="id_categoria" >Categoria Eventi</label>
        <div class="col-sm-5 col-lg-5">
            <select id="id_categoria" name="id_categoria" class="validate[required]">
                    {% for t in pageData['newscategory'] %}
                    {% if t.denominazione == "EVENTI" %}
                <option value="{{t.id}}" {{ 'selected="selected"' if t.id == pageData["dao"].id_categoria}}  >{{t.denominazione}} </option>
                {% endif %}
                    {% endfor %}
            </select>
        </div>
    </div>

    <div class="form-group" title="Bottoni di salvataggio e reset del form">
        <div class="col-sm-5 col-lg-5 col-sm-offset-2">
<button type="submit" class="btn btn-large btn-danger jumbo">Salva</button>
        </div>
    </div>

</form>
<script src="/tpl/pg/js/plugins/jQuery-Validation-Engine/js/languages/jquery.validationEngine-en.js"></script>
<script src="/tpl/pg/js/plugins/jQuery-Validation-Engine/js/jquery.validationEngine.js"></script>
<script src="/tpl/ic/js/summernote.min.js"></script>
<script src="/tpl/ic/js/summernote-it-IT.js"></script>
<script type="text/javascript">
$(document).ready(function(){

$('#summernote2').summernote({
    lang: 'it-IT',
     //airMode: true,
  toolbar: [
    //[groupname, [button list]]

    //['style', ['bold', 'italic', 'underline', 'clear','color']],
    //['font', ['strikethrough']],
    //['fontsize', ['fontsize']],
    //['color', ['color']],
    //['para', ['ul', 'ol', 'paragraph']],
    //['height', ['height']],
    //['misc',['undo','redo']]
  ]
});


      $('#ae_form').on('submit', function (e) {
        $("#mySubmission").val($('#summernote').code());
      });

});
</script>
